package com.mallcloud.mall.mall.api.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mallcloud.mall.common.core.constant.enums.mall.OrderEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel(value = "MallOrderCouponVO", description = "支付订单")
@Data
@EqualsAndHashCode(callSuper = false)
public class MallOrderCouponVO implements Serializable {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty(value = "编号")
	private Long id;

	@ApiModelProperty(value = "订单号")
	private String orderNo;

	/**
	 * {@link OrderEnum.StatusEnum}
	 */
	@ApiModelProperty(value = "订单状态")
	private Integer status;

	/**
	 * {@link OrderEnum.PayedEnum}
	 */
	@ApiModelProperty(value = "是否已支付")
	private Boolean hasPayed;

	@ApiModelProperty(value = "交易金额")
	private BigDecimal money;

	@ApiModelProperty(value = "优惠金额")
	private BigDecimal discountAmount;

	@ApiModelProperty(value = "最终金额")
	private BigDecimal finalMoney;

	@ApiModelProperty(value = "顾客手机号")
	private String phone;

	@ApiModelProperty(value = "顾客卡号")
	private String cardNo;

	@ApiModelProperty(value = "商户号")
	private String mchId;

	@ApiModelProperty(value = "门店号")
	private String storeNo;

	@ApiModelProperty(value = "支付时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date payTime;

	@ApiModelProperty(value = "创建时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	@ApiModelProperty(value = "订单版本号，每处理一次订单，版本号+1")
	private Integer version;

	@ApiModelProperty(value = "备注")
	private String remark;

	@ApiModelProperty(value = "失败原因")
	private String exceptions;

	@ApiModelProperty(value = "业务类型 ORDER_PARK-停车订单 ORDER_COUPON-券订单")
	private String orderType;

	@ApiModelProperty(value = "业务数据")
	private String attach;

	//拓展-----------
	@ApiModelProperty(value = "券ids")
	private String couponIds;

}
